function Main(){
	
}
Main.init = function(){
	$.controller("addCommand", new TestCommand(), SrfBetEvent.TEST_TYPE);
	$.controller("addCommand", new LocalSroreUserCommand(), SrfBetEvent.LOCAL_PERSIST_USER);
	$.controller("addCommand", new LoginUserCommand(), SrfBetEvent.LOCAL_LOGIN_USER);
	$.controller("addCommand", new UpdateRoleCommand(), SrfBetEvent.UPDATE_ROLE);
	$.controller("addCommand", new UpdateDomainCommand(), SrfBetEvent.UPDATE_DOMAIN);
	$.controller("addCommand", new GetFBProfileCommand(), SrfBetEvent.GET_FBPROFILE);
	$.controller("addCommand", new UpdateUserCommand(), SrfBetEvent.UPDATE_USER);
	$.controller("addCommand", new LogOutCommand(), SrfBetEvent.LOGOUT_USER);
	Main.parseUrlParams();
}

Main.urlParams = {};

Main.parseUrlParams = function () {
	var e,
        a = /\+/g,  // Regex for replacing addition symbol with a space
        r = /([^&=]+)=?([^&]*)/g,
        d = function (s) { return decodeURIComponent(s.replace(a, " ")); },
        q = window.location.search.substring(1);
        //facebook sends values back in the hash, so adjust if that is the case
        if( window.location.hash != false ){
        	q = window.location.hash.replace('#', '?').substring(1);
        }
    while (e = r.exec(q))
    	Main.urlParams[d(e[1])] = d(e[2]);
}
